package com.linkage.jz.bankruptcy.fragment.Project;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.PointF;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.google.gson.Gson;
import com.linkage.jz.bankruptcy.BankruptcyApp;
import com.linkage.jz.bankruptcy.Consts;
import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.AddProxyUserActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.ApplyChangeToMeActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.ChangeToMeActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.ChangeZQUserBaseInfoActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.ChangeZQUserBaseNewInfoActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ApplyAddProxyUserActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ApplyChangerLegalRepActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ApplyChangerLegalUserNameActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ChangerLegalRepActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ChangerLegalUserNameActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper.ChangerZQUserNameActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.ZQUserShowDetailActivity;
import com.linkage.jz.bankruptcy.activity.Project.ZQUser.ZQUserZQDetailActivity;
import com.linkage.jz.bankruptcy.adapter.FileAdapter;
import com.linkage.jz.bankruptcy.adapter.FullyGridLayoutManager;
import com.linkage.jz.bankruptcy.base.BaseCreateActivity;
import com.linkage.jz.bankruptcy.bean.ApplyChangerZQUserNameBean;
import com.linkage.jz.bankruptcy.bean.LastChange;
import com.linkage.jz.bankruptcy.bean.ManagerUserInfo;
import com.linkage.jz.bankruptcy.bean.TaskAtta;
import com.linkage.jz.bankruptcy.bean.ZQUserChangeDetailBaseInfo;
import com.linkage.jz.bankruptcy.bean.ZQUserDetailAuthBaseInfo;
import com.linkage.jz.bankruptcy.bean.ZQUserDetailBaseInfo;
import com.linkage.jz.bankruptcy.bean.ZQUserInfo2;
import com.linkage.jz.bankruptcy.event.RefreshEvent;
import com.linkage.jz.bankruptcy.fragment.MsgFragment;
import com.linkage.jz.bankruptcy.utils.SPUtils;
import com.linkage.jz.bankruptcy.utils.Utils;
import com.linkage.jz.bankruptcy.widget.PublicNoticeDialog;
import com.linkage.jz.bankruptcy.widget.ZQUserBaseReplyDialog;
import com.linkage.seapeak.activity.message.GoToPageLoadingActivity;
import com.linkage.seapeak.base.BaseFragment;
import com.linkage.seapeak.pojo.UploadImage;

import org.greenrobot.eventbus.EventBus;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Text;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

import static com.chad.library.adapter.base.listener.SimpleClickListener.TAG;

/**
 * @author FT
 * @time 2016-07-18 16:49
 * 债权人债权人详情 tab-基础详情
 */

// JUMP 
public class ZQZQUserBaseDetailFragment extends BaseFragment {
    RecyclerView mRecyclerView;
    private Context context;
    private int mPage;
    public static final String MERCHANT_DETAILS_PAGE = "MERCHANT_DETAILS_PAGE";
    private DemoAdapter mAdapter;

    private ZQUserBaseReplyDialog dialog;
    List<String> mFoodData;
    List<String> mMovieData;
    List<String> mHaveFunData;
    List<String> mEvaluationData;
//    private static ZQUserInfo mInfo;
    private TextView tv_editname;
    private static String mProid;
    private static String creditorId;
    private  List<ZQUserDetailBaseInfo>  zqUserDetailInfo;

    private RecyclerView mImgRecyclerView1;
    private List<TaskAtta> mImgList1 = new ArrayList<>();
    private FileAdapter mImgAdapter1;

    private RecyclerView mImgRecyclerView2;
    private List<TaskAtta> mImgList2 = new ArrayList<>();
    private FileAdapter mImgAdapter2;
    private static Activity mActivity;

    private RecyclerView mImgRecyclerView3;
    private List<TaskAtta> mImgList3 = new ArrayList<>();
    private FileAdapter mImgAdapter3;
    private PublicNoticeDialog noticeDialog;

    private RecyclerView mImgRecyclerView4;
    private List<TaskAtta> mImgList4 = new ArrayList<>();
    private FileAdapter mImgAdapter4;

    public static ZQZQUserBaseDetailFragment newInstance(int page, String creditorid, String proid) {
        Bundle args = new Bundle();
        args.putInt(MERCHANT_DETAILS_PAGE, page);
//        mInfo = info;
        creditorId = creditorid;
        mProid = proid;
        ZQZQUserBaseDetailFragment tripFragment = new ZQZQUserBaseDetailFragment();
        tripFragment.setArguments(args);
        return tripFragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPage = getArguments().getInt(MERCHANT_DETAILS_PAGE);
        context = getActivity().getApplicationContext();
        zqUserDetailInfo = new ArrayList<ZQUserDetailBaseInfo>();
        setData();
//        getData();
    }

    @Override
    public void onResume() {
        getData();
        super.onResume();
    }


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_zq_detail_base, container, false);
        mRecyclerView = (RecyclerView) view.findViewById(R.id.mRecyclerView);
        switch (mPage){
            case 0:
                initAdapter(zqUserDetailInfo);
                break;


        }
//        tv_editname = vie

        return view;
    }

    private void setData(){
        mFoodData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mFoodData.add("美食"+i);
        }
        mMovieData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mMovieData.add("电影"+i);
        }
        mHaveFunData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mHaveFunData.add("玩乐"+i);
        }
        mEvaluationData = new ArrayList<>();
        for(int i=0; i<1;i++){
            mEvaluationData.add("评价"+i);
        }
    }

//    private PublicNoticeDialog noticeDialog;
    /**
     * 设置RecyclerView属性
     */
    private void initAdapter(List<ZQUserDetailBaseInfo> data) {
//        mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LISTAL_LIST));

        mRecyclerView.setLayoutManager(new LinearLayoutManagerWithSmoothScroller(getActivity()));
        mAdapter = new DemoAdapter(getActivity(), R.layout.fragment_zq_detail_base_item, data);
        mAdapter.openLoadAnimation();

        mRecyclerView.setAdapter(mAdapter);//设置adapter
        //设置item点击事件
        mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
            @Override
            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {

                switch (view.getId()) {

                    case R.id.btn_commit:
//                        EditManagerUserInfoActivity.start(getActivity(),mInfo);
                        dialog = new ZQUserBaseReplyDialog(getActivity(),onClickListener);
                        dialog.show();
                        break;

                    case R.id.tv_editname1:
                    case R.id.tv_editname2:
                    case R.id.tv_editname3:
                    case R.id.tv_editname4:
                    case R.id.tv_editname5:
                    case R.id.tv_editname6:
                        String str = ((TextView)view).getText().toString();
                        if(str == null || "待审核".equalsIgnoreCase(str))
                        {
                            return;
                        }

                        ZQUserDetailBaseInfo info  = new ZQUserDetailBaseInfo();
                        if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
                        {
                            info = zqUserDetailInfo.get(0);
                        }

                        ChangerZQUserNameActivity.start(getActivity(), info, "1", 1);
                        break;
//                    case R.id.tv_editname21:
//
//                        break;

                    case R.id.tv_change_legalname1:


                        if (zqUserDetailInfo != null && zqUserDetailInfo.size() > 0) {
                            final ZQUserDetailBaseInfo infotmp2 = zqUserDetailInfo.get(0);

//                            ChangerLegalRepActivity.start(getActivity(), infotmp2, "0", 1,0);
                            ChangerLegalUserNameActivity.start(getActivity(), infotmp2, 1, 1);
                        }


                        break;
                    case R.id.tv_change_proxy_legalname1:

                        final ZQUserDetailBaseInfo infotmp3 = zqUserDetailInfo.get(0);

//                        ChangerLegalUserNameActivity.start(getActivity(), infotmp3, 1, 1);
                        ChangerLegalUserNameActivity.start(getActivity(), infotmp3, 1, 1);
//                        ChangerLegalRepActivity.start(getActivity(), infotmp3, "0", 1,0);
                        break;

                    case R.id.img_group_legal_cardnum:
                        break;
                    //变更代理人
                    case R.id.tv_change_proxyname1:
                    case R.id.tv_person_base_pyname_py_4:
                    case R.id.tv_person_base_pyname_py_5:

                        String str1 = ((TextView)view).getText().toString();
                        if(str1 == null || "待审核".equalsIgnoreCase(str1))
                        {
                            return;
                        }
                        final ZQUserDetailBaseInfo infotmp2 = zqUserDetailInfo.get(0);

                        AddProxyUserActivity.start(getActivity(), mProid, creditorId, 1, 1);

                        break;


                }
            }
        });

    }

    private View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            switch (v.getId()) {

                case R.id.btn_chancel:
                    dialog.dismiss();
                    break;
                case R.id.btn_save:
                    String msg = dialog.text_reason.getText().toString().trim();
                    String status = "1";
                    if(dialog.cb_nopass.isChecked())
                    {
                        status = "2";
                    }
                    String notifyTypes="";
                    if(dialog.send_msg.isChecked() && dialog.send_phone.isChecked())
                    {
                        notifyTypes = "0,1";
                    }else if(dialog.send_msg.isChecked() ){
                        notifyTypes = "0";
                    }else{
                        notifyTypes = "1";
                    }


//                    addZQUser(name,phone);
                    applyPerson(status,msg,notifyTypes);
                    break;

            }
        }
    };

    public void applyPerson(String status,String msg,String notifyTypes)
    {
        if(BankruptcyApp.tokeninfo == null|| BankruptcyApp.tokeninfo.getToken() == null)
        {
            return;
        }

        OkHttpClient okHttpClient = new OkHttpClient();
//        HashMap<String, String> params = new HashMap<String, String>();
        Random random = new Random();
        String rom = random.nextLong()+"";
        String timestamp =System.currentTimeMillis()+"";
        String userToken = SPUtils.getInstance(Consts.SPNAME).getString("userToken","");
        String userId = SPUtils.getInstance(Consts.SPNAME).getString("userId","");

        RequestBody requestBody = new FormBody.Builder()
                .add("appid","1000000001")
                .add("nonce",rom)
                .add("timestamp", timestamp)
                .add("token", BankruptcyApp.tokeninfo.getToken())
                .add("userToken",userToken)
                .add("creditorId", creditorId)
                .add("status", status)
                .add("msg",msg)
                .add("notifyTypes", notifyTypes)
                .build();

        String url = Consts.WEBURL_INDENTITYAUDIT;
        Request request = new Request.Builder()
                .url(url)
                .post(requestBody)
                .build();

        okHttpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
//                shapeLoadingDialog.dismiss();
//                Log.d(TAG, "onFailure: " + e.getMessage());
                getActivity().runOnUiThread(new Runnable(){

                    @Override
                    public void run() {
                        //更新UI
                        Toast.makeText(getActivity(),"保存失败",Toast.LENGTH_SHORT).show();

                    }

                });
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
//                Log.d(TAG, response.protocol() + " " +response.code() + " " + response.message());
                Headers headers = response.headers();
//

                String str = response.body().string();
                try{
                    JSONObject object = new JSONObject(str);
                    if(object.optInt("code") == 0)
                    {
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                //更新UI
                                RefreshEvent event = new RefreshEvent();
                                event.setType(RefreshEvent.FLASHZQUSERDETAIL);
                                EventBus.getDefault().post(event);
                                Toast.makeText(getActivity(), "保存成功", Toast.LENGTH_SHORT).show();

                            }

                        });
//                        finish();

                    }else {
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                //更新UI
                                Toast.makeText(getActivity(), "保存失败", Toast.LENGTH_SHORT).show();

                            }

                        });

                    }
                    str = "";
                }catch (Exception ex)
                {
                    ex.printStackTrace();
                    getActivity().runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                            //更新UI
                            Toast.makeText(getActivity(), "保存失败", Toast.LENGTH_SHORT).show();

                        }

                    });
                }
            }
        });
    }

    /**
     * adapter
     */
    class DemoAdapter extends BaseQuickAdapter<ZQUserDetailBaseInfo, BaseViewHolder> {
        int mLayoutId;
        public DemoAdapter(Context context, int LayoutId, List<ZQUserDetailBaseInfo> info) {
            super( LayoutId, info);
            mLayoutId = LayoutId;
        }

        @Override
        public void convert(BaseViewHolder helper, ZQUserDetailBaseInfo info) {
            helper.setGone(R.id.btn_commit,false);
            helper.setGone(R.id.base_2,false);


            if (info == null) {
                return;
            }


            helper.setVisible(R.id.tv_editname1,false);
            helper.setVisible(R.id.tv_editname2,false);
            helper.setVisible(R.id.tv_editname3,false);
            helper.setVisible(R.id.tv_editname4,false);
            helper.setVisible(R.id.tv_editname5,false);
            helper.setVisible(R.id.tv_editname6,false);
            helper.setVisible(R.id.tv_change_legalname1,false);

            helper.addOnClickListener(R.id.tv_editname1);
            helper.addOnClickListener(R.id.tv_editname2);

            helper.addOnClickListener(R.id.tv_editname3);
            helper.addOnClickListener(R.id.tv_editname4);
            helper.addOnClickListener(R.id.tv_editname5);
            helper.addOnClickListener(R.id.tv_editname6);
            helper.addOnClickListener(R.id.tv_change_legalname1);
            helper.addOnClickListener(R.id.tv_person_base_pyname_py_4);
            helper.addOnClickListener(R.id.tv_person_base_pyname_py_5);

            helper.addOnClickListener(R.id.tv_change_proxy_legalname1);
            helper.addOnClickListener(R.id.tv_change_proxyname1);


//            if(info.getIdentityStatus()==null )
//            {
//
//            }

            if (info.lastChange != null) {
                helper.setVisible(R.id.ll_feedback, true);
                String title = "";
                title = info.lastChange.getType().getText();
                if ("0".equalsIgnoreCase(info.lastChange.getAuditStatus().getValue())) {
                    title = title + "中";
                } else if ("2".equalsIgnoreCase(info.lastChange.getAuditStatus().getValue())) {
                    title = title + "不通过，查看原因";
                }

                LinearLayout ll_feedback = (LinearLayout) helper.getView(R.id.ll_feedback);
                final String lastType = info.lastChange.getType().getText();
                if(("新增代理人".equalsIgnoreCase(lastType)||"变更债权人".equalsIgnoreCase(lastType)
            ||"变更为本人操作".equalsIgnoreCase(lastType)||"变更为法定代表人操作".equalsIgnoreCase(lastType)||"变更为新的法定代表人操作".equalsIgnoreCase(lastType)) &&"2".equalsIgnoreCase(info.lastChange.getAuditStatus().getValue()))
                {
                    ll_feedback.setOnClickListener(new View.OnClickListener() {

                        @Override
                        public void onClick(View v) {
//                UnReadAll();
                            noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    if (v.getId() == R.id.btn_save_notice) {
//123456

                                        if("变更为法定代表人操作".equalsIgnoreCase(lastType))
                                        {
                                           // 变更为法定代表人操作
                                            ZQUserDetailBaseInfo infotmp = new ZQUserDetailBaseInfo();

                                            infotmp.setBankruptcyProjectId(info.getBankruptcyProjectId());
                                            infotmp.setId(info.getId());


                                            if("0".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
                                            {
                                                ChangerLegalRepActivity.start(getActivity(), info, "1", 1, 2);
                                            }else{
                                                ChangerLegalRepActivity.start(getActivity(), info, "1", 1, 1);
                                            }


                                        }else if("变更债权人".equalsIgnoreCase(lastType))
                                        {
                                            //变更债权人
                                            ZQUserDetailBaseInfo infotmp = new ZQUserDetailBaseInfo();
                                            infotmp.setId(info.getId());
                                            infotmp.setBankruptcyProjectId(info.getBankruptcyProjectId());
                                            ChangeZQUserBaseNewInfoActivity.start(getActivity(), infotmp, 1, 1);
                                        }else if("新增代理人".equalsIgnoreCase(lastType))
                                        {
                                            //新增代理人
                                            AddProxyUserActivity.start(getActivity(), info.getBankruptcyProjectId(), creditorId, 0, 1);
                                        }else if("变更为本人操作".equalsIgnoreCase(lastType))
                                        {
                                            //变更为本人
                                            ZQUserDetailBaseInfo infotmp = new ZQUserDetailBaseInfo();
                                            infotmp.setBankruptcyProjectId(info.getBankruptcyProjectId());
                                            infotmp.setId(info.getId());
                                            ChangeToMeActivity.start(getActivity(), info, creditorId, "1", 1);

                                        }else if("变更为新的法定代表人操作".equalsIgnoreCase(lastType))
                                        {
                                            //变更为本人
                                            ZQUserDetailBaseInfo infotmp = new ZQUserDetailBaseInfo();
                                            infotmp.setBankruptcyProjectId(info.getBankruptcyProjectId());
                                            infotmp.setId(info.getId());
                                            ChangerLegalRepActivity.start(getActivity(), info, "1", 1, 2);

                                        }

                                        noticeDialog.dismiss();
                                    } else {
                                        noticeDialog.dismiss();
                                    }
                                    changeId(info.getLastChange().getId());
                                }
                            }, 1, "审查意见", info.lastChange.getAuditDetail(),
                                    "放弃修改", "再次修改");
                            noticeDialog.show();
                        }
                    });
                }

                if(("新增代理人".equalsIgnoreCase(lastType)||"变更债权人".equalsIgnoreCase(lastType)
                        ||"变更为本人操作".equalsIgnoreCase(lastType)||"变更为法定代表人操作".equalsIgnoreCase(lastType)||"变更为新的法定代表人操作".equalsIgnoreCase(lastType)) &&"0".equalsIgnoreCase(info.lastChange.getAuditStatus().getValue()))
                {
                    ll_feedback.setOnClickListener(new View.OnClickListener() {

                        @Override
                        public void onClick(View v)
                        {
                            if("新增代理人".equalsIgnoreCase(lastType))
                            {
                                ApplyChangerZQUserNameBean beantmp1 = new ApplyChangerZQUserNameBean();
                                beantmp1.setChange(info.change);
                                ApplyAddProxyUserActivity.start(getActivity(), beantmp1, 1);
                            }

                            if("变更债权人".equalsIgnoreCase(lastType))
                            {

//                                ZQUserDetailBaseInfo beantmp1 = new ZQUserDetailBaseInfo();
//                                beantmp1.setChange(info.change);
////                                ZQUserDetailBaseInfo info = new Gson().fromJson(pageData.getAsJsonObject("creditorInfo"),ZQUserDetailBaseInfo.class);
//
//                                ZQUserShowDetailActivity.start(getActivity(), beantmp1);

                            }

                            if("变更为本人操作".equalsIgnoreCase(lastType))
                            {
                                ApplyChangerZQUserNameBean beantmp1 = new ApplyChangerZQUserNameBean();
                                beantmp1.setChange(info.change);
                                ApplyChangeToMeActivity.start(getActivity(), beantmp1, 1);


                            }

                            if("变更为法定代表人操作".equalsIgnoreCase(lastType))
                            {


                                ApplyChangerZQUserNameBean beantmp1 = new ApplyChangerZQUserNameBean();
                                beantmp1.setChange(info.change);
                                ApplyChangerLegalRepActivity.start(getActivity(), beantmp1, 1,true);
                            }

                            if("变更为新的法定代表人操作".equalsIgnoreCase(lastType))
                            {


                                ApplyChangerZQUserNameBean beantmp1 = new ApplyChangerZQUserNameBean();
                                beantmp1.setChange(info.change);
                                ApplyChangerLegalRepActivity.start(getActivity(), beantmp1, 1,false);
                            }

                        }
                    });
                }


                helper.setText(R.id.tv_pro_module_item_add0, title);

            }else{
                helper.setGone(R.id.ll_feedback, false);
            }

//            if (info.getIdentityStatus() != null && "0".equalsIgnoreCase(info.getIdentityStatus().getValue()))
//            {
//                helper.setVisible(R.id.btn_commit, true);
//                helper.addOnClickListener(R.id.btn_commit);
//            }
            helper.setGone(R.id.group_userbase_show, false);
            helper.setGone(R.id.group_user_proxyer_base_show, false);


            helper.setGone(R.id.group_userbase_show,false);
            helper.setGone(R.id.group_user_proxyer_base_show, false);
            helper.setGone(R.id.zqbase_personbase_show, false);
            helper.setGone(R.id.activity_edit_zqbase_person_userbase_proxyer_show,false);
            helper.setGone(R.id.activity_edit_zqbase_tax_userbase_proxyer_show,false);

            if (info != null && (info.getIdentityBigTypes() == null))
            {
                helper.setVisible(R.id.base_2,true);
                helper.setText(R.id.tv_zq_name,info.getCreditorName());
                helper.setVisible(R.id.tv_editname1, false);
                helper.setVisible(R.id.tv_editname2, false);
                helper.setGone(R.id.tv_editname21, false);
                helper.setVisible(R.id.tv_editname3, false);
                helper.setVisible(R.id.tv_editname4, false);
                helper.setVisible(R.id.tv_editname5, false);
                helper.setVisible(R.id.tv_editname6, false);
                helper.setVisible(R.id.tv_change_legalname1, false);

                helper.setVisible(R.id.tv_person_base_pyname_py_5, false);
                helper.setGone(R.id.tv_person_base_pyname_py_51, false);
                helper.setVisible(R.id.tv_person_base_pyname_py_4, false);
                helper.setGone(R.id.tv_person_base_pyname_py_41, false);


                if (info.getContact() == null || "".equalsIgnoreCase(info.getContact())) {


                    helper.setText(R.id.tv_zq_phone, "——");
                    helper.setVisible(R.id.tv_zq_phone_add, true);
                    helper.addOnClickListener(R.id.tv_zq_phone_add);
                    helper.setVisible(R.id.tv_zq_setuser, true);
                    helper.addOnClickListener(R.id.tv_zq_setuser);
                    helper.setVisible(R.id.tv_zq_phone_notice, true);
                } else {
                    helper.setText(R.id.tv_zq_phone, info.getContact());
                    helper.setVisible(R.id.tv_zq_phone_add, false);
                    helper.setVisible(R.id.tv_zq_phone_notice, false);
                    if ("true".equalsIgnoreCase(info.getIsVirtualAccount())) {
                        helper.setVisible(R.id.tv_zq_setuser_notice, true);
                    } else {
                        helper.setVisible(R.id.tv_zq_setuser_notice, false);
                    }
                }



            }
            else if("0".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "0".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2,false);
                helper.setGone(R.id.group_userbase_show,true);
                helper.setText(R.id.tv_editname2, "变更");
                helper.setGone(R.id.tv_editname21, false);

                if (!"2".equalsIgnoreCase(info.getOnlineStatus().getValue())&&!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())) {


                    if( info.getAuth().isChangeOfCreditorName()) {
                        helper.setVisible(R.id.tv_editname2, true);


                        if (info.changeCreditorName != null) {
//                        helper.setVisible(R.id.ll_feedback, false);
                            String title = "";
                            title = info.changeCreditorName.getType().getText();
                            if ("0".equalsIgnoreCase(info.changeCreditorName.getAuditStatus().getValue())) {
                                title = "待审核";
                                helper.setText(R.id.tv_editname2, title);
                            } else if ("2".equalsIgnoreCase(info.changeCreditorName.getAuditStatus().getValue())) {

                                title = "再次修改";
                                helper.setText(R.id.tv_editname2, title);

                                title = "不通过，查看原因";
                                helper.setVisible(R.id.tv_editname21, true);
                                helper.setText(R.id.tv_editname21, title);


                                TextView tv_editname21 = (TextView) helper.getView(R.id.tv_editname21);
                                tv_editname21.setOnClickListener(new View.OnClickListener() {

                                    @Override
                                    public void onClick(View v) {
//                UnReadAll();
                                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                            @Override
                                            public void onClick(View v) {
                                                if (v.getId() == R.id.btn_save_notice) {
//                                                ZQUserDetailBaseInfo info  = new ZQUserDetailBaseInfo();
//                                                if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
//                                                {
//                                                    info = zqUserDetailInfo.get(0);
//                                                }

                                                    ChangerZQUserNameActivity.start(getActivity(), info, "1", 1);
//                                    finish();
                                                    noticeDialog.dismiss();
                                                } else {
                                                    noticeDialog.dismiss();
                                                }
                                                changeId(info.getChangeCreditorName().getId());
                                            }
                                        }, 1, "审查意见", info.changeCreditorName.getAuditDetail(),
                                                "放弃修改", "再次修改");
                                        noticeDialog.show();
                                    }
                                });

                            }

                        }
                    }

//                    helper.setVisible(R.id.tv_change_legalname1, true);
                }
                helper.setText(R.id.zq_group_base_name,  Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.group_base_social,  Utils.tmpString(info.getSocialUniformCreditCode()));
                helper.setText(R.id.group_base_legalname,  Utils.tmpString(info.getLegalRepresentativeName()));
                helper.setText(R.id.group_legal_phone,  Utils.tmpString(info.getContact()));
                helper.setText(R.id.group_legal_other_phone, Utils.tmpString(info.getOtherContact()) );
                helper.setText(R.id.group_legal_other_email,  Utils.tmpString(info.getEmail()));
                helper.setText(R.id.group_base_bankinfo1, "账户名：" +  Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.group_base_bankinfo2, "开户行：" +  Utils.tmpString(info.getBank()));
                helper.setText(R.id.group_base_bankinfo3, "账号：" +  Utils.tmpString(info.getBankAccount()));

                helper.setText(R.id.group_legal_cardnum, hideMidText( Utils.tmpString(info.getCardNumber())));
                final ImageView img_group_legal_cardnum = (ImageView) helper.getView(R.id.img_group_legal_cardnum);

                final TextView group_legal_cardnum = (TextView) helper.getView(R.id.group_legal_cardnum);
                final String strCardNumber = info.getCardNumber();
                img_group_legal_cardnum.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (group_legal_cardnum.getText().toString().indexOf("*") == -1) {
                            group_legal_cardnum.setText(hideMidText(strCardNumber));
                            img_group_legal_cardnum.setImageResource(R.drawable.icon_visible);
                        } else {
                            group_legal_cardnum.setText(strCardNumber);
                            img_group_legal_cardnum.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });

                final ImageView group_legal_other_email_click = (ImageView) helper.getView(R.id.group_legal_other_email_click);
                final String strEmail = info.getEmail();
                group_legal_other_email_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.group_legal_addr, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.group_legal_addr,  Utils.tmpString(""));
                }

                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.group_userbase_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideBusinessLicenseAttas() != null) {
                    mImgList1.addAll(info.getProvideBusinessLicenseAttas());

                }

//                FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView1.setLayoutManager(manager);
//                mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList1.clear();
//                mImgAdapter1.setList(mImgList1);
//                mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                if (info.getProvideBusinessLicenseAttas() != null) {
//                    for (int i = 0; i < info.getProvideBusinessLicenseAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideBusinessLicenseAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList1, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_recycler1_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_recycler1,  false);
                }else{
                    helper.setGone(R.id.group_userbase_recycler1_txt,  false);
                    helper.setVisible(R.id.group_userbase_recycler1,  true);
                }




                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getProvideCardAttas() != null) {
                    mImgList2.addAll(info.getProvideCardAttas());

                }
//                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_recycler2);
//                mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView2.setLayoutManager(manager2);
//                mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList2.clear();
//                mImgAdapter2.setList(mImgList2);
//                mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                if (info.getProvideCardAttas() != null) {
//                    for (int i = 0; i < info.getProvideCardAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideCardAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList2, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvideCard().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_recycler2_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_recycler2,  false);
                }else{
                    helper.setGone(R.id.group_userbase_recycler2_txt,  false);
                    helper.setVisible(R.id.group_userbase_recycler2,  true);
                }

                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_recycler3);
                mImgRecyclerView3.setNestedScrollingEnabled(false);

                mImgAdapter3 = new FileAdapter(getActivity(), mImgList3);
                mImgRecyclerView3.setLayoutManager(mImgAdapter3.createLayoutManager());
                mImgRecyclerView3.setAdapter(mImgAdapter3);
                mImgList3.clear();

                if (info.getProvideLegalRepresentativeAttas() != null) {
                    mImgList3.addAll(info.getProvideLegalRepresentativeAttas());

                }

//                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_recycler3);
//                mImgRecyclerView3.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager3 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView3.setLayoutManager(manager3);
//                mImgAdapter3 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList3.clear();
//                mImgAdapter3.setList(mImgList3);
//                mImgRecyclerView3.setAdapter(mImgAdapter3);
//
//                if (info.getProvideLegalRepresentativeAttas() != null) {
//                    for (int i = 0; i < info.getProvideLegalRepresentativeAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideLegalRepresentativeAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList3.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList3, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvideLegalRepresentative().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_recycler3_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_recycler3,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_recycler3_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_recycler3,  false);
                }else{
                    helper.setGone(R.id.group_userbase_recycler3_txt,  false);
                    helper.setVisible(R.id.group_userbase_recycler3,  true);
                }

            }
            else if("0".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "1".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2,false);

                helper.setGone(R.id.group_userbase_show, false);
                helper.setGone(R.id.group_user_proxyer_base_show, true);


                if (!"2".equalsIgnoreCase(info.getOnlineStatus().getValue())&&!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())) {

//                    helper.setVisible(R.id.tv_change_proxy_legalname1, true);
//                    helper.setVisible(R.id.tv_change_proxyname1, true);


                    helper.setGone(R.id.tv_editname31, false);

                    if( info.getAuth().isChangeOfCreditorName()) {
                        helper.setVisible(R.id.tv_editname3, true);
                        helper.setText(R.id.tv_editname3, "变更");

                        if (info.changeCreditorName != null) {
//                        helper.setVisible(R.id.ll_feedback, false);
                            String title = "";
                            title = info.changeCreditorName.getType().getText();
                            if ("0".equalsIgnoreCase(info.changeCreditorName.getAuditStatus().getValue())) {
                                title = "待审核";
                                helper.setText(R.id.tv_editname3, title);
                            } else if ("2".equalsIgnoreCase(info.changeCreditorName.getAuditStatus().getValue())) {

                                title = "再次修改";
                                helper.setText(R.id.tv_editname3, title);

                                title = "不通过，查看原因";
                                helper.setVisible(R.id.tv_editname31, true);
                                helper.setText(R.id.tv_editname31, title);

                                TextView tv_editname21 = (TextView) helper.getView(R.id.tv_editname31);
                                tv_editname21.setOnClickListener(new View.OnClickListener() {

                                    @Override
                                    public void onClick(View v) {
//                UnReadAll();
                                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                            @Override
                                            public void onClick(View v) {
                                                if (v.getId() == R.id.btn_save_notice) {
//                                                ZQUserDetailBaseInfo info  = new ZQUserDetailBaseInfo();
//                                                if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
//                                                {
//                                                    info = zqUserDetailInfo.get(0);
//                                                }

                                                    ChangerZQUserNameActivity.start(getActivity(), info, "1", 1);
//                                    finish();
                                                    noticeDialog.dismiss();
                                                } else {
                                                    noticeDialog.dismiss();
                                                }
                                                changeId(info.getChangeCreditorName().getId());
                                            }
                                        }, 1, "审查意见", info.changeCreditorName.getAuditDetail(),
                                                "放弃修改", "再次修改");
                                        noticeDialog.show();
                                    }
                                });

                            }

                        }
                    }

                        if (info.getAuth().isChangeOfLegalRepresentative()) {
                            helper.setVisible(R.id.tv_change_proxy_legalname1, true);

                            helper.setText(R.id.tv_change_proxy_legalname1, "变更");
                            helper.setGone(R.id.tv_change_proxy_legalname11, false);
                            if (info.changeLegalRepresentative != null) {
//                        helper.setVisible(R.id.ll_feedback, false);
                                String title = "";
                                title = info.changeLegalRepresentative.getType().getText();
                                if ("0".equalsIgnoreCase(info.changeLegalRepresentative.getAuditStatus().getValue())) {
                                    title = "待审核";
                                    helper.setText(R.id.tv_change_proxy_legalname1, title);
                                } else if ("2".equalsIgnoreCase(info.changeLegalRepresentative.getAuditStatus().getValue())) {

                                    title = "再次修改";
                                    helper.setText(R.id.tv_change_proxy_legalname1, title);

                                    title = "不通过，查看原因";
                                    helper.setVisible(R.id.tv_change_proxy_legalname11, true);
                                    helper.setText(R.id.tv_change_proxy_legalname11, title);

                                    TextView tv_editname21 = (TextView) helper.getView(R.id.tv_change_proxy_legalname11);
                                    tv_editname21.setOnClickListener(new View.OnClickListener() {

                                        @Override
                                        public void onClick(View v) {
//                UnReadAll();
                                            noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                                @Override
                                                public void onClick(View v) {
                                                    if (v.getId() == R.id.btn_save_notice) {
                                                        ZQUserDetailBaseInfo info = new ZQUserDetailBaseInfo();
                                                        if (zqUserDetailInfo != null && zqUserDetailInfo.size() > 0) {
                                                            info = zqUserDetailInfo.get(0);
                                                        }

//                                                AddProxyUserActivity.start(getActivity(), info.getBankruptcyProjectId(), info.getId(), 1, 1);
//                                    finish();
                                                        ChangerLegalUserNameActivity.start(getActivity(), info, 1, 1);
                                                        noticeDialog.dismiss();
                                                    } else {
                                                        noticeDialog.dismiss();
                                                    }
                                                    changeId(info.getChangeLegalRepresentative().getId());
                                                }
                                            }, 1, "审查意见", info.changeLegalRepresentative.getAuditDetail(),
                                                    "放弃修改", "再次修改");
                                            noticeDialog.show();
                                        }
                                    });

                                }

                            }
                        }


                    if( info.getAuth().isChangeOfAgent()) {
                        helper.setVisible(R.id.tv_change_proxyname1, true);
                        helper.setText(R.id.tv_change_proxyname1, "变更");
                        helper.setGone(R.id.tv_change_proxyname11, false);

                        if (info.changeAgent != null) {
//                        helper.setVisible(R.id.ll_feedback, false);
                            String title = "";
                            title = info.changeAgent.getType().getText();
                            if ("0".equalsIgnoreCase(info.changeAgent.getAuditStatus().getValue())) {
                                title = "待审核";
                                helper.setText(R.id.tv_change_proxyname1, title);
                            } else if ("2".equalsIgnoreCase(info.changeAgent.getAuditStatus().getValue())) {

                                title = "再次修改";
                                helper.setText(R.id.tv_change_proxyname1, title);

                                title = "不通过，查看原因";
                                helper.setVisible(R.id.tv_change_proxyname11, true);
                                helper.setText(R.id.tv_change_proxyname11, title);

                                TextView tv_editname21 = (TextView) helper.getView(R.id.tv_change_proxyname11);
                                tv_editname21.setOnClickListener(new View.OnClickListener() {

                                    @Override
                                    public void onClick(View v) {
//                UnReadAll();
                                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                            @Override
                                            public void onClick(View v) {
                                                if (v.getId() == R.id.btn_save_notice) {
//                                                ZQUserDetailBaseInfo info  = new ZQUserDetailBaseInfo();
//                                                if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
//                                                {
//                                                    info = zqUserDetailInfo.get(0);
//                                                }

                                                    AddProxyUserActivity.start(getActivity(), info.getBankruptcyProjectId(), info.getId(), 1, 1);
//                                    finish();
                                                    noticeDialog.dismiss();
                                                } else {
                                                    noticeDialog.dismiss();
                                                }
                                                changeId(info.getChangeAgent().getId());
                                            }
                                        }, 1, "审查意见", info.changeAgent.getAuditDetail(),
                                                "放弃修改", "再次修改");
                                        noticeDialog.show();
                                    }
                                });

                            }

                        }
                    }
                }


                helper.setText(R.id.zq_group_base_name_py,  Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.tv_zqr_base_jg_social,  Utils.tmpString(info.getSocialUniformCreditCode()));
                helper.setText(R.id.tv_zqr_base_legalname,  Utils.tmpString(info.getLegalRepresentativeName()));
//                helper.setText(R.id.group_base_social_py,);
                helper.setText(R.id.group_base_legalname_py,  Utils.tmpString(info.getAgentName()));
                helper.setText(R.id.group_legal_phone_py,  Utils.tmpString(info.getContact()));
                helper.setText(R.id.group_legal_other_phone_py,  Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.group_legal_other_email_py,  Utils.tmpString(info.getEmail()));

                final ImageView group_legal_other_email_py_click = (ImageView) helper.getView(R.id.group_legal_other_email_py_click);
                final String strEmail = info.getEmail();
                group_legal_other_email_py_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                helper.setText(R.id.group_base_bankinfo1_py, "账户名：" + Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.group_base_bankinfo2_py, "开户行：" + Utils.tmpString(info.getBank()));
                helper.setText(R.id.group_base_bankinfo3_py, "账号：" + Utils.tmpString(info.getBankAccount()));

                helper.setText(R.id.group_legal_cardnum_py, Utils.tmpString(info.getAgentLicenseNumber()));

                helper.setText(R.id.group_legal_cardnum_py, hideMidText(info.getCreditorsIDCardNumber()));
                final ImageView img_group_legal_cardnum_py = (ImageView) helper.getView(R.id.img_group_legal_cardnum_py);

                final TextView group_legal_cardnum = (TextView) helper.getView(R.id.group_legal_cardnum_py);
                final String strAgentLicenseNumber = info.getAgentLicenseNumber();
                img_group_legal_cardnum_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (group_legal_cardnum.getText().toString().indexOf("*") == -1) {
                            group_legal_cardnum.setText(hideMidText(strAgentLicenseNumber));
                            img_group_legal_cardnum_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            group_legal_cardnum.setText(strAgentLicenseNumber);
                            img_group_legal_cardnum_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.group_legal_addr_py, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.group_legal_addr_py, Utils.tmpString(""));
                }

                mImgRecyclerView4 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler4);
                mImgRecyclerView4.setNestedScrollingEnabled(false);

                mImgAdapter4 = new FileAdapter(getActivity(), mImgList4);
                mImgRecyclerView4.setLayoutManager(mImgAdapter4.createLayoutManager());
                mImgRecyclerView4.setAdapter(mImgAdapter4);
                mImgList4.clear();

                if (info.getProvideLegalRepresentativeAttas() != null) {
                    mImgList4.addAll(info.getProvideLegalRepresentativeAttas());

                }

//                mImgRecyclerView4 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler4);
//                mImgRecyclerView4.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager4 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView4.setLayoutManager(manager4);
//                mImgAdapter4 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList4.clear();
//                mImgAdapter4.setList(mImgList4);
//                mImgRecyclerView4.setAdapter(mImgAdapter4);
//
//                if (info.getProvideLegalRepresentativeAttas() != null) {
//                    for (int i = 0; i < info.getProvideLegalRepresentativeAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideLegalRepresentativeAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList4.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList4, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }
                if("1".equalsIgnoreCase(info.getProvideLegalRepresentative().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler4_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler4_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler4,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler4_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler4_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler4,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler4_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler4,  true);
                }

                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideBusinessLicenseAttas() != null) {
                    mImgList1.addAll(info.getProvideBusinessLicenseAttas());

                }

//                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler1);
//                mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView1.setLayoutManager(manager);
//                mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList1.clear();
//                mImgAdapter1.setList(mImgList1);
//                mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                if (info.getProvideBusinessLicenseAttas() != null) {
//                    for (int i = 0; i < info.getProvideBusinessLicenseAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideBusinessLicenseAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList1, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }
                if("1".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler1_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler1,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler1_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler1,  true);
                }


                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getCreditorsProvideCardAttas() != null) {
                    mImgList2.addAll(info.getCreditorsProvideCardAttas());

                }

//                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler2);
//                mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView2.setLayoutManager(manager2);
//                mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList2.clear();
//                mImgAdapter2.setList(mImgList2);
//                mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                if (info.getCreditorsProvideCardAttas() != null) {
//                    for (int i = 0; i < info.getCreditorsProvideCardAttas().size(); i++) {
//                        TaskAtta atta = info.getCreditorsProvideCardAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList2, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getCreditorsProvideCard().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler2_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler2,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler2_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler2,  true);
                }


                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler3);
                mImgRecyclerView3.setNestedScrollingEnabled(false);

                mImgAdapter3 = new FileAdapter(getActivity(), mImgList3);
                mImgRecyclerView3.setLayoutManager(mImgAdapter3.createLayoutManager());
                mImgRecyclerView3.setAdapter(mImgAdapter3);
                mImgList3.clear();

                if (info.getProvidePowerAttorneyAttas() != null) {
                    mImgList3.addAll(info.getProvidePowerAttorneyAttas());

                }
//                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.group_userbase_proxy_recycler3);
//                mImgRecyclerView3.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager3 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView3.setLayoutManager(manager3);
//                mImgAdapter3 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList3.clear();
//                mImgAdapter3.setList(mImgList3);
//                mImgRecyclerView3.setAdapter(mImgAdapter3);
//
//                if (info.getProvidePowerAttorneyAttas() != null) {
//                    for (int i = 0; i < info.getProvidePowerAttorneyAttas().size(); i++) {
//                        TaskAtta atta = info.getProvidePowerAttorneyAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList3.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList3, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvidePowerAttorney().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler3_txt,  "线下提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler3,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.group_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.group_userbase_proxy_recycler3_txt,  "已提供");
                    helper.setGone(R.id.group_userbase_proxy_recycler3,  false);
                }else{
                    helper.setGone(R.id.group_userbase_proxy_recycler3_txt,  false);
                    helper.setVisible(R.id.group_userbase_proxy_recycler3,  true);
                }

            }else if("1".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "2".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2,false);
                helper.setGone(R.id.zqbase_personbase_show,true);

                helper.setText(R.id.zq_person_base_name, Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.person_legal_phone, Utils.tmpString(info.getContact()));
                helper.setText(R.id.person_legal_other_phone, Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.person_legal_other_email, Utils.tmpString(info.getEmail()));
                final ImageView person_legal_other_email_click = (ImageView) helper.getView(R.id.person_legal_other_email_click);
                final String strEmail = info.getEmail();
                person_legal_other_email_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                helper.setText(R.id.person_base_bankinfo1, "账户名：" +  Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.person_base_bankinfo2, "开户行：" +  Utils.tmpString(info.getBank()));
                helper.setText(R.id.person_base_bankinfo3, "账号：" +  Utils.tmpString(info.getBankAccount()));
                helper.setText(R.id.person_legal_cardnum, hideMidText(info.getCardNumber()));
                if (info.getAddressInfo() != null)
                {
                    helper.setText(R.id.person_legal_addr,  Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.person_legal_addr,  Utils.tmpString(""));
                }

//                helper.setText(R.id.group_legal_cardnum,hideMidText(info.getCardNumber()));
                final ImageView img_person_legal_cardnum = (ImageView) helper.getView(R.id.img_person_legal_cardnum);

                final TextView person_legal_cardnum = (TextView) helper.getView(R.id.person_legal_cardnum);
                final String strCardNumber = info.getCardNumber();
                img_person_legal_cardnum.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (person_legal_cardnum.getText().toString().indexOf("*") == -1) {
                            person_legal_cardnum.setText(hideMidText(strCardNumber));
                            img_person_legal_cardnum.setImageResource(R.drawable.icon_visible);
                        } else {
                            person_legal_cardnum.setText(strCardNumber);
                            img_person_legal_cardnum.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideCardAttas() != null) {
                    mImgList1.addAll(info.getProvideCardAttas());

                }

//                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler1);
//                mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView1.setLayoutManager(manager);
//                mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList1.clear();
//                mImgAdapter1.setList(mImgList1);
//                mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                if (info.getProvideCardAttas() != null) {
//                    for (int i = 0; i < info.getProvideCardAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideCardAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList1, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvideCard().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler1_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler1,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_recycler1_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_recycler1,  true);
                }

            }
            else if("1".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "1".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
            {
                helper.setGone(R.id.base_2,false);
                helper.setGone(R.id.activity_edit_zqbase_person_userbase_proxyer_show,true);


                if (!"2".equalsIgnoreCase(info.getOnlineStatus().getValue())&&!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())
                        && !"3".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"4".equalsIgnoreCase(info.getProcessStatus().getValue())) {

                    if( info.getAuth().isChangeOfAgent()) {
                        helper.setVisible(R.id.tv_person_base_pyname_py_4, true);

                        if (info.changeAgent != null) {
//                        helper.setVisible(R.id.ll_feedback, false);
                            String title = "";
                            title = info.changeAgent.getType().getText();
                            if ("0".equalsIgnoreCase(info.changeAgent.getAuditStatus().getValue())) {
                                title = "待审核";
                                helper.setText(R.id.tv_person_base_pyname_py_4, title);
                            } else if ("2".equalsIgnoreCase(info.changeAgent.getAuditStatus().getValue())) {

                                title = "再次修改";
                                helper.setText(R.id.tv_person_base_pyname_py_4, title);

                                title = "不通过，查看原因";
                                helper.setVisible(R.id.tv_person_base_pyname_py_41, true);
                                helper.setText(R.id.tv_person_base_pyname_py_41, title);

                                TextView tv_editname21 = (TextView) helper.getView(R.id.tv_person_base_pyname_py_41);
                                tv_editname21.setOnClickListener(new View.OnClickListener() {

                                    @Override
                                    public void onClick(View v) {
//                UnReadAll();
                                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                            @Override
                                            public void onClick(View v) {
                                                if (v.getId() == R.id.btn_save_notice) {
//                                                ZQUserDetailBaseInfo info  = new ZQUserDetailBaseInfo();
//                                                if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
//                                                {
//                                                    info = zqUserDetailInfo.get(0);
//                                                }

                                                    AddProxyUserActivity.start(getActivity(), info.getBankruptcyProjectId(), info.getId(), 1, 1);
//                                    finish();
                                                    noticeDialog.dismiss();
                                                } else {
                                                    noticeDialog.dismiss();
                                                }

                                                changeId(info.changeAgent.getId());
                                            }
                                        }, 1, "审查意见", info.changeAgent.getAuditDetail(),
                                                "放弃修改", "再次修改");
                                        noticeDialog.show();
                                    }
                                });

                            }

                        }
                    }
                }


                helper.setText(R.id.zq_person_base_name_py,  Utils.tmpString(info.getCreditorName()));

                helper.setText(R.id.zq_person_base_pyname_py,  Utils.tmpString(info.getAgentName()));
                helper.setText(R.id.person_legal_phone_py,  Utils.tmpString(info.getContact()));
                helper.setText(R.id.person_legal_other_phone_py,  Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.person_legal_other_email_py,  Utils.tmpString(info.getEmail()));

                final ImageView person_legal_other_email_py_click = (ImageView) helper.getView(R.id.person_legal_other_email_py_click);
                final String strEmail = info.getEmail();
                person_legal_other_email_py_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });


                helper.setText(R.id.person_base_bankinfo1_py, "账户名：" +  Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.person_base_bankinfo2_py, "开户行：" +  Utils.tmpString(info.getBank()));
                helper.setText(R.id.person_base_bankinfo3_py, "账号：" +  Utils.tmpString(info.getBankAccount()));
                helper.setText(R.id.person_legal_cardnum_py, hideMidText( Utils.tmpString(info.getCreditorsIDCardNumber())));
                helper.setText(R.id.person_legal_cardnum_cr_py, hideMidText( Utils.tmpString(info.getCardNumber())));


                final ImageView img_person_legal_cardnum_py = (ImageView) helper.getView(R.id.img_person_legal_cardnum_py);

                final TextView person_legal_cardnum_py = (TextView) helper.getView(R.id.person_legal_cardnum_py);
                final String strCardNumber = info.getCreditorsIDCardNumber();
                img_person_legal_cardnum_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (person_legal_cardnum_py.getText().toString().indexOf("*") == -1) {
                            person_legal_cardnum_py.setText(hideMidText(strCardNumber));
                            img_person_legal_cardnum_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            person_legal_cardnum_py.setText(strCardNumber);
                            img_person_legal_cardnum_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                final ImageView img_person_legal_cardnum_cr_py = (ImageView) helper.getView(R.id.img_person_legal_cardnum_cr_py);

                final TextView person_legal_cardnum_cr_py = (TextView) helper.getView(R.id.person_legal_cardnum_cr_py);
                final String strCrCardNumber = info.getCardNumber();
                img_person_legal_cardnum_cr_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (person_legal_cardnum_cr_py.getText().toString().indexOf("*") == -1) {
                            person_legal_cardnum_cr_py.setText(hideMidText(strCrCardNumber));
                            img_person_legal_cardnum_cr_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            person_legal_cardnum_cr_py.setText(strCrCardNumber);
                            img_person_legal_cardnum_cr_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });


                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.person_legal_addr_py, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.person_legal_addr_py, Utils.tmpString(""));
                }

                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_py_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getProvideCardAttas() != null) {
                    mImgList1.addAll(info.getProvideCardAttas());

                }

//                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_py_recycler1);
//                mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView1.setLayoutManager(manager);
//                mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList1.clear();
//                mImgAdapter1.setList(mImgList1);
//                mImgRecyclerView1.setAdapter(mImgAdapter1);


//                if (info.getProvideCardAttas() != null) {
//                    for (int i = 0; i < info.getProvideCardAttas().size(); i++) {
//                        TaskAtta atta = info.getProvideCardAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvideCard().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_py_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_py_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_py_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_py_recycler1_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_py_recycler1_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_py_recycler1,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_py_recycler1_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_py_recycler1,  true);
                }

                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getCreditorsProvideCardAttas() != null) {
                    mImgList2.addAll(info.getCreditorsProvideCardAttas());

                }

//                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler2);
//                mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView2.setLayoutManager(manager2);
//                mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList2.clear();
//                mImgAdapter2.setList(mImgList2);
//                mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                if (info.getCreditorsProvideCardAttas() != null) {
//                    for (int i = 0; i < info.getCreditorsProvideCardAttas().size(); i++) {
//                        TaskAtta atta = info.getCreditorsProvideCardAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList2, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getCreditorsProvideCard().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler2_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler2,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_recycler2_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_recycler2,  true);
                }


                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler3);
                mImgRecyclerView3.setNestedScrollingEnabled(false);

                mImgAdapter3 = new FileAdapter(getActivity(), mImgList3);
                mImgRecyclerView3.setLayoutManager(mImgAdapter3.createLayoutManager());
                mImgRecyclerView3.setAdapter(mImgAdapter3);
                mImgList3.clear();

                if (info.getProvidePowerAttorneyAttas() != null) {
                    mImgList3.addAll(info.getProvidePowerAttorneyAttas());

                }

//                mImgRecyclerView3 = (RecyclerView) helper.getView(R.id.person_userbase_proxy_recycler3);
//                mImgRecyclerView3.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager3 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView3.setLayoutManager(manager3);
//                mImgAdapter3 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList3.clear();
//                mImgAdapter3.setList(mImgList3);
//                mImgRecyclerView3.setAdapter(mImgAdapter3);
//
//                if (info.getProvidePowerAttorneyAttas() != null) {
//                    for (int i = 0; i < info.getProvidePowerAttorneyAttas().size(); i++) {
//                        TaskAtta atta = info.getProvidePowerAttorneyAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList3.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList3, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvidePowerAttorney().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler3_txt,  "线下提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler3,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.person_userbase_proxy_recycler3_txt,  true);
                    helper.setText(R.id.person_userbase_proxy_recycler3_txt,  "已提供");
                    helper.setGone(R.id.person_userbase_proxy_recycler3,  false);
                }else{
                    helper.setGone(R.id.person_userbase_proxy_recycler3_txt,  false);
                    helper.setVisible(R.id.person_userbase_proxy_recycler3,  true);
                }


            }else if("2".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) )
            {
                helper.setGone(R.id.base_2,false);
                helper.setGone(R.id.activity_edit_zqbase_tax_userbase_proxyer_show,true);
                if (!"2".equalsIgnoreCase(info.getOnlineStatus().getValue())&&!"0".equalsIgnoreCase(info.getProcessStatus().getValue()) && !"1".equalsIgnoreCase(info.getProcessStatus().getValue())) {

                    if( info.getAuth().isChangeOfAgent()) {


                        helper.setVisible(R.id.tv_person_base_pyname_py_5, true);
                        if (info.changeAgent != null) {
//                        helper.setVisible(R.id.ll_feedback, false);
                            String title = "";
                            title = info.changeAgent.getType().getText();
                            if ("0".equalsIgnoreCase(info.changeAgent.getAuditStatus().getValue())) {
                                title = "待审核";
                                helper.setText(R.id.tv_person_base_pyname_py_5, title);
                            } else if ("2".equalsIgnoreCase(info.changeAgent.getAuditStatus().getValue())) {

                                title = "再次修改";
                                helper.setText(R.id.tv_person_base_pyname_py_5, title);

                                title = "不通过，查看原因";
                                helper.setVisible(R.id.tv_person_base_pyname_py_51, true);
                                helper.setText(R.id.tv_person_base_pyname_py_51, title);

                                TextView tv_editname21 = (TextView) helper.getView(R.id.tv_person_base_pyname_py_51);
                                tv_editname21.setOnClickListener(new View.OnClickListener() {

                                    @Override
                                    public void onClick(View v) {
//                UnReadAll();
                                        noticeDialog = new PublicNoticeDialog(getActivity(), new View.OnClickListener() {
                                            @Override
                                            public void onClick(View v) {
                                                if (v.getId() == R.id.btn_save_notice) {
//                                                ZQUserDetailBaseInfo info  = new ZQUserDetailBaseInfo();
//                                                if(zqUserDetailInfo != null && zqUserDetailInfo.size()>0)
//                                                {
//                                                    info = zqUserDetailInfo.get(0);
//                                                }

                                                    AddProxyUserActivity.start(getActivity(), info.getBankruptcyProjectId(), info.getId(), 1, 1);
//                                    finish();
                                                    noticeDialog.dismiss();
                                                } else {
                                                    noticeDialog.dismiss();
                                                }
                                                changeId(info.changeAgent.getId());
                                            }
                                        }, 1, "审查意见", info.changeAgent.getAuditDetail(),
                                                "放弃修改", "再次修改");
                                        noticeDialog.show();
                                    }
                                });

                            }

                        }
                    }
                }
                helper.setText(R.id.zq_tax_base_name_py, Utils.tmpString(info.getCreditorName()));
                helper.setText(R.id.zq_tax_base_pyname_py, Utils.tmpString(info.getAgentName()));
                helper.setText(R.id.tax_legal_phone_py, Utils.tmpString(info.getContact()));
                helper.setText(R.id.tax_legal_other_phone_py, Utils.tmpString(info.getOtherContact()));
                helper.setText(R.id.tax_legal_other_email_py, Utils.tmpString(info.getEmail()));

                final ImageView tax_legal_other_email_py_click = (ImageView) helper.getView(R.id.tax_legal_other_email_py_click);
                final String strEmail = Utils.tmpString(info.getEmail());
                tax_legal_other_email_py_click.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (!"".equalsIgnoreCase(strEmail)) {
                            Intent data = new Intent(Intent.ACTION_SENDTO);
                            data.setData(Uri.parse("mailto:" + strEmail));
                            data.putExtra(Intent.EXTRA_SUBJECT, "");
                            data.putExtra(Intent.EXTRA_TEXT, "");
                            startActivity(data);
                        }
                    }
                });

                helper.setText(R.id.tax_base_bankinfo1_py, "账户名：" + Utils.tmpString(info.getBankAccountName()));
                helper.setText(R.id.tax_base_bankinfo2_py, "开户行：" + Utils.tmpString(info.getBank()));
                helper.setText(R.id.tax_base_bankinfo3_py, "账号：" + Utils.tmpString(info.getBankAccount()));
                helper.setText(R.id.tax_legal_cardnum_py, hideMidText(Utils.tmpString(info.getCreditorsIDCardNumber())));
                if (info.getAddressInfo() != null) {
                    helper.setText(R.id.tax_legal_addr_py, Utils.tmpString(info.getAddressInfo().getDetailString()));
                }else{
                    helper.setText(R.id.tax_legal_addr_py, Utils.tmpString(""));
                }


                final ImageView img_tax_legal_cardnum_py = (ImageView) helper.getView(R.id.img_tax_legal_cardnum_py);

                final TextView tax_legal_cardnum_py = (TextView) helper.getView(R.id.tax_legal_cardnum_py);
                final String strCardNumber = info.getCreditorsIDCardNumber();
                img_tax_legal_cardnum_py.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (tax_legal_cardnum_py.getText().toString().indexOf("*") == -1) {
                            tax_legal_cardnum_py.setText(hideMidText(strCardNumber));
                            img_tax_legal_cardnum_py.setImageResource(R.drawable.icon_visible);
                        } else {
                            tax_legal_cardnum_py.setText(strCardNumber);
                            img_tax_legal_cardnum_py.setImageResource(R.drawable.icon_unvisible);

                        }
                    }
                });

                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler1);
                mImgRecyclerView1.setNestedScrollingEnabled(false);

                mImgAdapter1 = new FileAdapter(getActivity(), mImgList1);
                mImgRecyclerView1.setLayoutManager(mImgAdapter1.createLayoutManager());
                mImgRecyclerView1.setAdapter(mImgAdapter1);
                mImgList1.clear();

                if (info.getCreditorsProvideCardAttas() != null) {
                    mImgList1.addAll(info.getCreditorsProvideCardAttas());

                }

//                mImgRecyclerView1 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler1);
//                mImgRecyclerView1.setNestedScrollingEnabled(false);
//
//                FullyGridLayoutManager manager = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView1.setLayoutManager(manager);
//                mImgAdapter1 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList1.clear();
//                mImgAdapter1.setList(mImgList1);
//                mImgRecyclerView1.setAdapter(mImgAdapter1);
//
//                if (info.getCreditorsProvideCardAttas() != null) {
//                    for (int i = 0; i < info.getCreditorsProvideCardAttas().size(); i++) {
//                        TaskAtta atta = info.getCreditorsProvideCardAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList1.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList1, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getCreditorsProvideCard().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler1_txt,  "线下提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler1,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler1_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler1_txt,  "已提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler1,  false);
                }else{
                    helper.setGone(R.id.tax_userbase_proxy_recycler1_txt,  false);
                    helper.setVisible(R.id.tax_userbase_proxy_recycler1,  true);
                }


                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler2);
                mImgRecyclerView2.setNestedScrollingEnabled(false);

                mImgAdapter2 = new FileAdapter(getActivity(), mImgList2);
                mImgRecyclerView2.setLayoutManager(mImgAdapter2.createLayoutManager());
                mImgRecyclerView2.setAdapter(mImgAdapter2);
                mImgList2.clear();

                if (info.getProvidePowerAttorneyAttas() != null) {
                    mImgList2.addAll(info.getProvidePowerAttorneyAttas());

                }
//                mImgRecyclerView2 = (RecyclerView) helper.getView(R.id.tax_userbase_proxy_recycler2);
//                mImgRecyclerView2.setNestedScrollingEnabled(false);
//
//
//                FullyGridLayoutManager manager2 = new FullyGridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false);
//                mImgRecyclerView2.setLayoutManager(manager2);
//                mImgAdapter2 = new BaseFragment.GridImagesAdapter(getActivity(), TYPE_PREVIEW);
//                mImgList2.clear();
//                mImgAdapter2.setList(mImgList2);
//                mImgRecyclerView2.setAdapter(mImgAdapter2);
//
//                if (info.getProvidePowerAttorneyAttas() != null) {
//                    for (int i = 0; i < info.getProvidePowerAttorneyAttas().size(); i++) {
//                        TaskAtta atta = info.getProvidePowerAttorneyAttas().get(i);
//                        JSONObject obj = new JSONObject();
//                        try {
//                            obj.putOpt("filename", atta.getAttachmentName());
//                            obj.putOpt("filepath", atta.getAttachmentDownloadAddress());
//                            obj.putOpt("filesize", atta.getAttachmentSize());
//                            obj.putOpt("loadUrl", atta.getAttachmentPreviewAddress());
//                            mImgList2.add(new Gson().fromJson(obj.toString(), UploadImage.class));
//                            BaseCreateActivity.sorFiles(mImgList2, true);
//                        } catch (JSONException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }

                if("1".equalsIgnoreCase(info.getProvidePowerAttorney().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler2_txt,  "线下提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler2,  false);
                }else  if("2".equalsIgnoreCase(info.getProvideBusinessLicense().getValue()))
                {
                    helper.setVisible(R.id.tax_userbase_proxy_recycler2_txt,  true);
                    helper.setText(R.id.tax_userbase_proxy_recycler2_txt,  "已提供");
                    helper.setGone(R.id.tax_userbase_proxy_recycler2,  false);
                }else{
                    helper.setGone(R.id.tax_userbase_proxy_recycler2_txt,  false);
                    helper.setVisible(R.id.tax_userbase_proxy_recycler2,  true);
                }
            }

            mRecyclerView.smoothScrollToPosition(0);

//            if(info!= null || info.getIdentityBigTypes() != null && "0".equalsIgnoreCase(info.getIdentityBigTypes().getValue()) && "0".equalsIgnoreCase(info.getIdentitySmallTypes().getValue()))
//            {
//                helper.setGone(R.id.base_2,false);
//                helper.setVisible(R.id.group_userbase_show,true);
//                helper.setText(R.id.tv_zq_name,info.getCreditorName());
//                //注意，这里缺判断
//                if("1".equalsIgnoreCase(info.getProcessStatus().getValue()) && "0".equalsIgnoreCase(info.getIdentityStatus().getValue())) {
//                    helper.setVisible(R.id.btn_commit, true);
//                    helper.addOnClickListener(R.id.btn_commit);
//                }else{
//                    helper.setGone(R.id.btn_commit, false);
//                    helper.addOnClickListener(R.id.btn_commit);
//                }
//            }


        }
    }


    public void getData()
    {
        if(BankruptcyApp.tokeninfo == null|| BankruptcyApp.tokeninfo.getToken() == null)
        {
            return;
        }
//        shapeLoadingDialog.setLoadingText("加载中...");
//        shapeLoadingDialog.setCanceledOnTouchOutside(false);
//        shapeLoadingDialog.show();
        OkHttpClient okHttpClient = new OkHttpClient();
//        HashMap<String, String> params = new HashMap<String, String>();
        Random random = new Random();
        String rom = random.nextLong()+"";
        String timestamp =System.currentTimeMillis()+"";
        String userToken = SPUtils.getInstance(Consts.SPNAME).getString("userToken","");
        String userId = SPUtils.getInstance(Consts.SPNAME).getString("userId","");


        RequestBody requestBody = new FormBody.Builder()
                .add("appid","1000000001")
                .add("nonce",rom)
                .add("timestamp", timestamp)

                .add("token", BankruptcyApp.tokeninfo.getToken())
                .add("userToken", userToken)

                .add("creditorId",creditorId)
                .add("projectId",mProid)
                .add("type","1")

                .build();

        String url = Consts.WEBURL_CREDITORINFO;
        Request request = new Request.Builder()
                .url(url)
                .post(requestBody)
                .build();

        okHttpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {

//                shapeLoadingDialog.dismiss();


                String str = response.body().string();

//                if(Consts.ISDEBUG)
//                {
//                    str = "{\"code\": 0,\"msg\":\"success\",\"data\": {\"groupList\": {\"综合管理组\": [{\"id\": \"222\",\"bankruptcyProjectId\": \"9c208e41eab641d59b88372c986605e9\",\"sysUserId\": \"93bec345da1d4699b2782c44bf190faf\",\"sysGroupId\": \"58cc083a3b944644b417b9134cdacb70\",\"subsidiaryOrgan\": \"江苏萌发科技有限公司\",\"groupLeader\": false,\"projectRole\": \"MANAGER\",\"projectColumnPermission\": \"0,1\",\"moneyPercent\": null,\"personnelPercent\": null,\"opManagementMembers\": false,\"opOtherMembers\": false,\"contactCreditor\": false,\"groupSentMessage\": false,\"sendSMS\": false,\"otherContactNumber\": \"\",\"user\": {\"id\": \"93bec345da1d4699b2782c44bf190faf\",\"loginname\": \"18655752308\",\"username\": \"王富贵\",\"avatar\": \"http://60.205.186.115:8001/group1/M00/00/04/rBHd5Fya1PmACFKoAAA7GwNBo1Q524-wmark.jpg?token=5cafcf4f7fefc726a00d3dc1cb3b506f&ts=1555298060\",\"company\": \"江苏萌发科技有限公司\",\"userOnline\": true,\"disabled\": false,\"email\": \"1262333517@qq.com\",\"mobile\": \"18655752308\",\"loginAt\": 1555291645,\"loginIp\": \"127.0.0.1\",\"loginCount\": 42,\"loginSessionId\": \"rshheaodbogbpo222899cl973s\",\"customMenu\": null,\"loginTheme\": \"palette.2.css\",\"menuTheme\": null,\"loginSidebar\": false,\"loginBoxed\": false,\"loginScroll\": true,\"loginPjax\": false,\"appInfoIdAndroid\": \"6748524783374e008f1103ea819a0fda\",\"appInfoIdIos\": null,\"unitid\": \"4db0951b9c5c4bbfbf6cf104cc2511c0\",\"unit\": null,\"appInfoIos\": null,\"appInfoAndroid\": null,\"roles\": null,\"units\": null,\"menus\": null,\"firstMenus\": null,\"secondMenus\": null,\"customMenus\": null,\"qq\": null,\"wx\": null,\"opBy\": \"93bec345da1d4699b2782c44bf190faf\",\"opAt\": 1551945057,\"delFlag\": false},\"group\": {\"id\": \"58cc083a3b944644b417b9134cdacb70\",\"bankruptcyProjectId\": \"9c208e41eab641d59b88372c986605e9\",\"code\": \"3lhb4vmfgmil6ofl7sonhepudp\",\"name\": \"综合管理组\",\"canDelete\": true,\"opBy\": \"93bec345da1d4699b2782c44bf190faf\",\"opAt\": 1554186594,\"delFlag\": false},\"opBy\": null,\"opAt\": null,\"delFlag\": false},{\"id\": \"68a0298f300949f89ed7715a6e87322c\",\"bankruptcyProjectId\": \"9c208e41eab641d59b88372c986605e9\",\"sysUserId\": \"6a779db54222423bbca09f0a46dfa112\",\"sysGroupId\": \"58cc083a3b944644b417b9134cdacb70\",\"subsidiaryOrgan\": null,\"groupLeader\": false,\"projectRole\": \"ADMINISTRATOR\",\"projectColumnPermission\": \"0,1,2,3,4,5,6\",\"moneyPercent\": null,\"personnelPercent\": null,\"opManagementMembers\": true,\"opOtherMembers\": false,\"contactCreditor\": false,\"groupSentMessage\": false,\"sendSMS\": false,\"otherContactNumber\": \"18949223929\",\"user\": {\"id\": \"6a779db54222423bbca09f0a46dfa112\",\"loginname\": \"18949223929\",\"username\": \"王富贵\",\"avatar\": \"\",\"company\": null,\"userOnline\": false,\"disabled\": false,\"email\": null,\"mobile\": \"18949223929\",\"loginAt\": null,\"loginIp\": null,\"loginCount\": 0,\"loginSessionId\": null,\"customMenu\": null,\"loginTheme\": null,\"menuTheme\": null,\"loginSidebar\": false,\"loginBoxed\": false,\"loginScroll\": false,\"loginPjax\": true,\"appInfoIdAndroid\": null,\"appInfoIdIos\": null,\"unitid\": \"4db0951b9c5c4bbfbf6cf104cc2511c0\",\"unit\": null,\"appInfoIos\": null,\"appInfoAndroid\": null,\"roles\": null,\"units\": null,\"menus\": null,\"firstMenus\": null,\"secondMenus\": null,\"customMenus\": null,\"qq\": null,\"wx\": null,\"opBy\": \"\",\"opAt\": 1554695416,\"delFlag\": false},\"group\": {\"id\": \"58cc083a3b944644b417b9134cdacb70\",\"bankruptcyProjectId\": \"9c208e41eab641d59b88372c986605e9\",\"code\": \"3lhb4vmfgmil6ofl7sonhepudp\",\"name\": \"综合管理组\",\"canDelete\": true,\"opBy\": \"93bec345da1d4699b2782c44bf190faf\",\"opAt\": 1554186594,\"delFlag\": false},\"opBy\": \"93bec345da1d4699b2782c44bf190faf\",\"opAt\": 1554695416,\"delFlag\": false}],\"负责人\": [{\"id\": \"111\",\"bankruptcyProjectId\": \"9c208e41eab641d59b88372c986605e9\",\"sysUserId\": \"f9ed9250560a4c49bdbc8bd38fa880e1\",\"sysGroupId\": \"20eec547dabf4ad9bb8e8899018eab7a\",\"subsidiaryOrgan\": null,\"groupLeader\": false,\"projectRole\": \"GROUPMEMBER\",\"projectColumnPermission\": \"0,1,2,3,4,5,6\",\"moneyPercent\": null,\"personnelPercent\": null,\"opManagementMembers\": true,\"opOtherMembers\": true,\"contactCreditor\": true,\"groupSentMessage\": true,\"sendSMS\": true,\"otherContactNumber\": \"13166330000\",\"user\": {\"id\": \"f9ed9250560a4c49bdbc8bd38fa880e1\",\"loginname\": \"15192282017\",\"username\": \"超级管理员\",\"avatar\": \"\",\"company\": null,\"userOnline\": true,\"disabled\": false,\"email\": \"wizzer@qq.com\",\"mobile\": \"15192282017\",\"loginAt\": 1555293607,\"loginIp\": \"127.0.0.1\",\"loginCount\": 58,\"loginSessionId\": \"ptert90374j4nrdumsq9q7nuia\",\"customMenu\": \"8c5d90d66c8149f19ef75855a45038f7,6e1aa6afe8ac44c9aed1b1a2883d683d,af28e4e506bc4cf795f7f84262befc15,1246a7fdc1eb46f8b3a7b193c5e47fd2,9a79503ec73c4d2788d46275834e2044\",\"loginTheme\": \"palette.2.css\",\"menuTheme\": \"top\",\"loginSidebar\": true,\"loginBoxed\": false,\"loginScroll\": false,\"loginPjax\": true,\"appInfoIdAndroid\": \"6748524783374e008f1103ea819a0fda\",\"appInfoIdIos\": \"36d661eaa4454ac9ade0373f04d58d03\",\"unitid\": \"4db0951b9c5c4bbfbf6cf104cc2511c0\",\"unit\": null,\"appInfoIos\": null,\"appInfoAndroid\": null,\"roles\": null,\"units\": null,\"menus\": null,\"firstMenus\": null,\"secondMenus\": null,\"customMenus\": null,\"qq\": null,\"wx\": null,\"opBy\": \"\",\"opAt\": 1551753746,\"delFlag\": false},\"group\": {\"id\": \"20eec547dabf4ad9bb8e8899018eab7a\",\"bankruptcyProjectId\": null,\"code\": \"administrator_group\",\"name\": \"负责人\",\"canDelete\": false,\"opBy\": \"f9ed9250560a4c49bdbc8bd38fa880e1\",\"opAt\": 1553567649,\"delFlag\": false},\"opBy\": null,\"opAt\": null,\"delFlag\": false}]},\"isManagerMember\": true,\"rolePermission\": {\"id\": \"222\",\"bankruptcyProjectId\": \"9c208e41eab641d59b88372c986605e9\",\"sysUserId\": \"93bec345da1d4699b2782c44bf190faf\",\"sysGroupId\": \"58cc083a3b944644b417b9134cdacb70\",\"subsidiaryOrgan\": \"江苏萌发科技有限公司\",\"groupLeader\": false,\"projectRole\": \"MANAGER\",\"projectColumnPermission\": \"0,1\",\"moneyPercent\": null,\"personnelPercent\": null,\"opManagementMembers\": false,\"opOtherMembers\": false,\"contactCreditor\": false,\"groupSentMessage\": false,\"sendSMS\": false,\"otherContactNumber\": \"\",\"user\": {\"id\": \"93bec345da1d4699b2782c44bf190faf\",\"loginname\": \"18655752308\",\"username\": \"王富贵\",\"avatar\": \"group1/M00/00/04/rBHd5Fya1PmACFKoAAA7GwNBo1Q524.jpg\",\"company\": \"江苏萌发科技有限公司\",\"userOnline\": true,\"disabled\": false,\"email\": \"1262333517@qq.com\",\"mobile\": \"18655752308\",\"loginAt\": 1555291645,\"loginIp\": \"127.0.0.1\",\"loginCount\": 42,\"loginSessionId\": \"rshheaodbogbpo222899cl973s\",\"customMenu\": null,\"loginTheme\": \"palette.2.css\",\"menuTheme\": null,\"loginSidebar\": false,\"loginBoxed\": false,\"loginScroll\": true,\"loginPjax\": false,\"appInfoIdAndroid\": \"6748524783374e008f1103ea819a0fda\",\"appInfoIdIos\": null,\"unitid\": \"4db0951b9c5c4bbfbf6cf104cc2511c0\",\"unit\": null,\"appInfoIos\": null,\"appInfoAndroid\": null,\"roles\": null,\"units\": null,\"menus\": null,\"firstMenus\": null,\"secondMenus\": null,\"customMenus\": null,\"qq\": null,\"wx\": null,\"opBy\": \"93bec345da1d4699b2782c44bf190faf\",\"opAt\": 1551945057,\"delFlag\": false},\"group\": null,\"opBy\": null,\"opAt\": null,\"delFlag\": false}}}\n";
 //                }
                try{


                    JSONObject object = new JSONObject(str);
                    if(object.optInt("code") == 0)
                    {
                        JSONObject dataobj = object.getJSONObject("data");
//                        JSONObject groupListobj = dataobj.getJSONObject("groupList");
//                        Iterator<String> it = groupListobj.keys();
                        List<ManagerUserInfo> list = new ArrayList<>();
                            Gson gson = new Gson();
                        zqUserDetailInfo.clear();
                        ZQUserDetailBaseInfo info = gson.fromJson(dataobj.optString("creditorInfo"),ZQUserDetailBaseInfo.class);
                        LastChange lastChange = gson.fromJson(dataobj.optString("lastChange"), LastChange.class);
                        ZQUserInfo2 change =  gson.fromJson(dataobj.optString("lastChange"), ZQUserInfo2.class);
                        LastChange changeCreditorName = new Gson().fromJson(dataobj.optString("changeCreditorName"), LastChange.class);
                        LastChange changeLegalRepresentative = new Gson().fromJson(dataobj.optString("changeLegalRepresentative"), LastChange.class);
                        LastChange changeAgent = new Gson().fromJson(dataobj.optString("changeAgent"), LastChange.class);
                        info.setIsVirtualAccount(dataobj.get("isVirtualAccount").toString());
                        info.lastChange = lastChange;
                        info.changeCreditorName = changeCreditorName;
                        info.changeLegalRepresentative = changeLegalRepresentative;
                        info.changeAgent = changeAgent;
                        info.change = change;
                        ZQUserDetailAuthBaseInfo auth = new Gson().fromJson(dataobj.optString("auth"), ZQUserDetailAuthBaseInfo.class);
                        info.setAuth(auth);
                        zqUserDetailInfo.add(info);

                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                mAdapter.notifyDataSetChanged();
                            }

                        });

                        str = "";

                    }

                }catch (Exception ex)
                {
                    ex.printStackTrace();
                }
            }
        });
    }

    private String hideMidText(String text) {
        String tmp = "";
        if (text.length() > 10) {
            tmp = text.substring(0, 6) + "******" + text.substring(text.length() - 4, text.length());

        } else {
            tmp = text;
        }
        return tmp;
    }


    public void changeId(String changeId)
    {

        if(BankruptcyApp.tokeninfo == null|| BankruptcyApp.tokeninfo.getToken() == null)
        {
            return;
        }

        OkHttpClient okHttpClient = new OkHttpClient();
        Random random = new Random();
        String rom = random.nextLong()+"";
        String timestamp =System.currentTimeMillis()+"";
        String userToken = SPUtils.getInstance(Consts.SPNAME).getString("userToken","");
        String userId = SPUtils.getInstance(Consts.SPNAME).getString("userId","");

        RequestBody requestBody = new FormBody.Builder()
                .add("appid","1000000001")
                .add("nonce",rom)
                .add("timestamp", timestamp)
                .add("token", BankruptcyApp.tokeninfo.getToken())
                .add("userToken",userToken)


                .add("projectId", mProid)
                .add("changeId", changeId)

                .build();

        String url = Consts.WEBURL_FEEDBACKKNOW;
        Request request = new Request.Builder()
                .url(url)
                .post(requestBody)
                .build();

        okHttpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {

//                Log.d(TAG, "onFailure: " + e.getMessage());
                getActivity().runOnUiThread(new Runnable(){

                    @Override
                    public void run() {
                        //更新UI
                        Toast.makeText(getActivity(),"保存失败",Toast.LENGTH_SHORT).show();

                    }

                });
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                Log.d(TAG, response.protocol() + " " +response.code() + " " + response.message());
                Headers headers = response.headers();

                for (int i = 0; i < headers.size(); i++) {
                    Log.d(TAG, headers.name(i) + ":" + headers.value(i));
                }


                String str = response.body().string();
                try{
                    final JSONObject object = new JSONObject(str);
                    if(object.optInt("code") == 0)
                    {
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                //更新UI
                                RefreshEvent event = new RefreshEvent();
                                event.setType(RefreshEvent.FLASHZQUSERDETAIL);
                                EventBus.getDefault().post(event);
                                getData();
                            }

                        });
//                        finish();

                    }else {
                        getActivity().runOnUiThread(new Runnable() {

                            @Override
                            public void run() {
                                //更新UI

                            }

                        });

                    }
                    str = "";
                }catch (Exception ex)
                {
                    ex.printStackTrace();
                    getActivity().runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                            //更新UI

                        }

                    });
                }
            }
        });
    }


    public class LinearLayoutManagerWithSmoothScroller extends LinearLayoutManager {

        public LinearLayoutManagerWithSmoothScroller(Context context) {
            super(context, VERTICAL, false);
        }

        public LinearLayoutManagerWithSmoothScroller(Context context, int orientation, boolean reverseLayout) {
            super(context, orientation, reverseLayout);
        }

        @Override
        public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state,
                                           int position) {
            RecyclerView.SmoothScroller smoothScroller = new LinearLayoutManagerWithSmoothScroller.TopSnappedSmoothScroller(recyclerView.getContext());
            smoothScroller.setTargetPosition(position);
            startSmoothScroll(smoothScroller);
        }

        private class TopSnappedSmoothScroller extends LinearSmoothScroller {
            public TopSnappedSmoothScroller(Context context) {
                super(context);

            }

            @Override
            public PointF computeScrollVectorForPosition(int targetPosition) {
                return LinearLayoutManagerWithSmoothScroller.this
                        .computeScrollVectorForPosition(targetPosition);
            }

            @Override
            protected int getVerticalSnapPreference() {
                return SNAP_TO_START;
            }
        }
    }



}
